The present invention relates to a music player for playing music data such as musical instrument digital interface (MIDI) data. The music player of the invention is applicable to a mobile phone, a personal digital assistance (PDA), a game player, and a MIDI player.
MIDI has been known as technology for playing music using music data. Patent Reference 1 has disclosed the MIDI technology. There has been known a MIDI player capable of playing MIDI data in a plurality of channels concurrently. With a MIDI player capable of playing a plurality of channels, it is possible to play, for example, a melody and background music at the same time.
In a conventional MIDI player capable of playing a plurality of channels, an input first-in-first-out (FIFO), a sequencer, an output FIFO, and a sound source are provided in each of the channels. The sequencer analyzes and processes content of an MIDI message, and converts the content to information (sound source drive information) for driving the sound source. In general, the sequencer is formed of software with a single central processing unit (CPU) in the MIDI player.
An MIDI message typically has a different length of data depending on a type of message, and may even have a variable length of data. Accordingly, each sequencer analyzes and processes in a different sequence for a different period of time. For example, when one sequencer complete a process for a single MIDI message and moves to a next process, another sequencer may not yet complete a process of another single MIDI message.
Accordingly, in the MIDI player capable of playing a plurality of channels, it may be necessary to stop another sequencer and move the one sequencer to the next process. If the one sequencer waits until another sequencer completes the process of another MIDI message, it is necessary to stop the one sequencer in the middle, thereby making it difficult to smoothly play the MIDI data.
Therefore, when a single CPU operates several sequencers in a plurality of channels, it is necessary to properly control the sequencers to analyze and process, and to maintain a state when a sequencer stops processing in the middle. As described above, the MIDI messages contain different contents with different lengths. Accordingly, in order to properly control the sequencers, it is necessary to provide a complex program.
When sequencers are switched with an existing operating system (OS) or a scheduler through a multi-task process, it is possible to control the sequencers relatively easily. However, it is necessary to provide a large capacity memory (read only memory, ROM, or random access memory, RAM) to provide such an OS or a scheduler. In particular, it is difficult to provide an OS in a compact MIDI player such as a melody player of a mobile phone.
Patent Reference 1; Japanese Patent Publication (Kokai) No. 2001-51678
In view of the problems described above, an object of the present invention is to provide a music player capable of controlling a plurality of sequencers with a simple program without an OS or a scheduler.
Further objects and advantages of the invention will be apparent from the following description of the invention.